Cavern

 Cavern4D

 Cavernize

 Debug

 FilterInterfaces

 Filters

 Format

 Helpers

 QuickEQ

 Remapping

 SpecialSources

 Spoofer

 Utilities

 Virtualizer

 Atmosphere

 AudioClip3D

 AudioListener3D

 AudioListener3DInspector

 AudioSource3D

 CavernizeRealtime

 Channel

 Clip

 Environments

 Jack

 Listener

  ActiveSources

  AttachPrioritySource(Source)

  AttachSource(Source)

  AudioQuality

  Channels

  defaultSampleRate

  DelayTarget

  DetachAllSources()

  DetachSource(Source)

  DirectLFE

  EnvironmentSize

  EnvironmentType

  GetLayoutName()

  HeadphoneVirtualizer

  Info

  IsSpherical

  IsSymmetric

  LFESeparation

  LFEVolume

  LimiterOnly

  Listener(bool)

  MaximumSources

  Normalizer

  operator bool(Listener)

  Ping()

  Position

  Range

  Render(int)

  ReplaceChannels(Channel[])

  ReplaceChannels(int)

  Rotation

  SampleRate

  ScreenSize

  UpdateRate

  Volume

 QualityModes

 Rolloffs

 SeatAdaptation

 Source

class Listener

Center of a listening space. Attached Sources will be rendered relative to this object's position.
VisibilityPublic
Modifierssealed

Public functions

void AttachPrioritySource(Source source)Attach a source to this listener, to the first place of the processing queue.
void AttachSource(Source source)Attach a source to this listener.
void DetachAllSources()Detach all sources from this listener.
void DetachSource(Source source)Detach a source from this listener.
Constructor Listener(bool loadGlobals = true)Center of a listening space. Attached Sources will be rendered relative to this object's position.
void Ping()Perform an update on all objects without rendering anything to the listener's output.
float[] Render(int frames = 1)Ask for update ticks.

Public static functions

string GetLayoutName()Current speaker layout name in the format of <main>.<LFE>.<height>.<floor>,
or simply "Virtualization".
implicit operator bool(Listener listener) Implicit null check.
void ReplaceChannels(Channel[] channels)Replace the channel layout.
void ReplaceChannels(int channelCount) Replace the channel layout with a standard of a given channel count.
The Listener will set up itself automatically with the user's saved configuration.
The used audio channels can be queried through Channels, which should be respected,
and the output audio channel count should be set to its length. If this is not possible,
the layout could be set to a standard by the number of channels with this function.

Public properties

IReadOnlyCollection<Source> ActiveSources Attached Sources.
QualityModes AudioQualityLower qualities increase performance for many sources.
int DelayTargetMaximum audio delay, defined in this FPS value. This is the minimum frame rate required to render continuous audio.
bool DirectLFEDisable lowpass on the LFE channel.
bool LFESeparationOnly mix LFE tagged sources to subwoofers.
float LFEVolumeLFE channels' amplitude multiplier.
bool LimiterOnlyIf active, the normalizer won't increase the volume above 100%.
int MaximumSourcesHow many sources can be played at the same time.
float NormalizerAdaption speed of the normalizer. 0 means disabled.
Vector3 PositionAbsolute spatial position.
float RangeHearing distance.
Vector3 RotationRotation in Euler angles (degrees).
int SampleRateProject sample rate (min. 44100). It's best to have all your audio clips in this sample rate for maximum performance.
int UpdateRateUpdate interval in audio samples (min. 16).
Lower values mean better interpolation, but require more processing power.
float VolumeGlobal playback amplitude multiplier.

Public static properties

Channel[] ChannelsOutput channel layout. The default setup is the standard 5.1.
Vector3 EnvironmentSizeThe single most important variable defining sound space in symmetric mode, the environment scaling.
Originally set by the user and applied when a Listener is created, however, overriding
it in specific applications can make a huge difference. Objects inside a box this size are positioned
inside the room, and defines the range of balance between left/right, front/rear, and top/bottom speakers.
Does not effect directional rendering. The user's settings should be
respected, thus this vector should be scaled, not completely overridden.
Environments EnvironmentType3D environment type.
bool HeadphoneVirtualizerVirtual surround effect for headphones. This will replace the active Channels on the next frame.
bool IsSphericalGets if the speakers are placed in a sphere according to current layout settings.
bool IsSymmetricIs the user's speaker layout symmetrical?
Vector2 ScreenSizeRelative size of the screen to the front wall's width. Used for rendering screen-anchored objects.
The user's settings should be respected, thus this vector should not be overridden without good reason.

Public variables

int defaultSampleRateDefault sample rate.
string InfoVersion and creator information.

See also

CavernUnity DLL.Cavern.Virtualizer.VirtualizerFilter.Process(float[] output, int sampleRate)Apply the virtualizer on the Listener's output, if the configuration matches the virtualization layout and filter sample rate.
CavernUnity DLL.Cavern.Source.Listener listenerThe Listener this source is attached to.